package ZombieCaminando;

import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.ImageIcon;

public class Fondo extends javax.swing.JPanel {
    ImageIcon imagen;
		
	public Fondo(String s) {
		super();		
		initGUI();
		imagen = new ImageIcon(getClass().getResource(s));
		setLayout(null);
	}
	
	protected void paintComponent(Graphics g){
		g.drawImage(imagen.getImage(),0,0,800,600,null);
		this.setOpaque(false);
		super.paintComponents(g);
		
		
	}
	
	private void initGUI() {
		try {
			setPreferredSize(new Dimension(800, 600));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
